#library(scDown)Set up the environment for running scVelo Part II by defining key variables.
Loading a .h5ad object containing spliced and unspliced RNA data is required. The cell type annotation column (annotation_column) is defined to specify the cell type or other annotation labels, ensuring the analysis runs with the correct group.
The working directory (output_dir) by default is the current directory and can be changed to specific path.
The mode to conduct scvelo velocity calculation can be either ‘stochastic (default)’, ‘deterministic’, or ‘dynamical (slowest)’
# Set the working directory
output_dir="/lab-share/RC-Data-Science-e2/Public/Qianyi/test_pipeline/scdown/scDown/tests"
# input h5ad file path and name
h5ad_file="inst/extdata/DentateGyrus/10X43_1.h5ad"
# specify which metadata column of the h5ad object contains cell type annotation
annotation_column <- "clusters"
# Mode to conduct scvelo velocity calculation, default 'stochastic'
mode = 'stochastic'
# The number of top differential velocity genes to plot phase portrait for, default 5
top_gene = 5This part performs RNA velocity calculations from .h5ad file using the original scVelo package. Workflow of this function: 1. calculate RNA velocity using scVelo workflow 2. cluster-specific differential velocity genes 3. trajectory inference using PAGA
start_time <- proc.time()
# Run scVelo Part II
run_scvelo_full(h5ad_file = h5ad_file,
output_dir = output_dir,
annotation_column = annotation_column)
end_time <- proc.time()
elapsed_time <- end_time - start_time
# Print the elapsed time
print(elapsed_time)# elapsed_time: 2 minThis step takes in an AnnData object in .h5ad and performs all basic velocity calculations enabled by scVelo. It also outputs basic figures such as spliced/unspliced count proportion and RNA velocity vectors on umap.
This plot visualizes the % spliced Vs. unspliced RNA for each cell
type.
This plot visualizes the velocity stream on UMAP embeddings.
This plot visualizes the vector grid on UMAP embeddings.
This plot visualizes the vector arrow on UMAP embeddings.